Repository navigation
mod: switch to upstream github.com/go-playground/validator/v10 - #53
Merged
Merged
Conversation
The flamego/validator fork (v10.9.0 minus go-playground's own translations) is being archived. Upstream exposes the same FieldError.Tag()/Param() used for i18n with flamego/i18n. - Use github.com/go-playground/validator/v10 v10.30.6, which requires Go 1.26. - Update expected error strings to upstream's format. - Drop invalid `dive` on struct fields in test fixtures; upstream panics on dive over a non-slice/map where v10.9.0 silently ignored it. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bbb1-1c5a-77ba-9e12-d22c3eb7db02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch from the
github.com/flamego/validatorfork to upstreamgithub.com/go-playground/validator/v10v10.30.6. The fork is v10.9.0 with go-playground's own translation system removed and is being archived.i18n with
flamego/i18nkeeps working: upstream'sFieldErrorhas the sameTag()andParam()used in the localization docs.Breaking changes
Options.Validatoris now*github.com/go-playground/validator/v10.Validate; update imports.FieldError.Error()text changes fromKey: "user.Age" Error: Field validation for "Age" ...to upstream'sKey: 'user.Age' Error:Field validation for 'Age' ....diveapplied to a field that isn't a slice or map, which v10.9.0 silently ignored. The test fixtures had this on a struct field and are fixed here.Test plan
go vet ./...andgo test ./...pass on Go 1.26.3.